package com.hns.dev.linys.guava.base;

import com.google.common.base.Optional;

/**
 * Created by linys on 2019/2/15.
 */
public class GuavaTest {

    public static void main(String[] args) {

        GuavaTest gt = new GuavaTest();
        Integer invalidInput = null;
        Optional<Integer> a =  Optional.of(invalidInput);
        Optional<Integer> b =  Optional.of(10);
        System.out.println(gt.sum(a, b));

    }

    public Integer sum(Optional<Integer> a, Optional<Integer> b){
        return a.get() + b.get();
    }

}
